package com.example.stock.service.impl;

import com.example.stock.excel.ExcelReaderUtil;
import com.example.stock.excel.StockWeekMonitor;
import com.example.stock.service.StockWeekMonitorService;
import com.example.stock.util.DataUtil;
import jakarta.annotation.PostConstruct;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
@Log4j2
public class StockWeekMonitorServiceImpl implements StockWeekMonitorService {

    private List<StockWeekMonitor> stockWeekMonitors;

    @PostConstruct
    private void init() {
        stockWeekMonitors = DataUtil.getListData(StockWeekMonitor.class, ExcelReaderUtil.FILE_OPERATION,"LongTerm");
    }

    @Override
    public List<StockWeekMonitor> getStockWeekMonitors() {
        return stockWeekMonitors;
    }
}